import { TPetTrain } from "../../../Message/Db/Tables/TPetTrain";
import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
type int = number;
//class PetTrainConfig
    
    export  class PetTrainConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (PetTrainConfig._instance != null) 
            {
                throw new Error(" PetTrainConfig 单例 ");
            }
            this.init();
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new TPetTrain();
                loc1.level = loc2.level;
                loc1.exp = loc2.exp;
                this._map[loc1.level] = loc1;
            }
            return;
        }

        public init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("t_pet_train.json");
            this.write(loc1);
            return;
        }

        public getExpByLevel(arg1: int): int
        {
            return (this._map[arg1] as TPetTrain).exp;
        }

        public static get instance(): PetTrainConfig
        {
            if (PetTrainConfig._instance == null) 
            {
                PetTrainConfig._instance = new PetTrainConfig();
            }
            return PetTrainConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: PetTrainConfig;
    }
